package com.easybbs.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @Author: yudaxian
 * @Description: 发送邮箱验证码的类型
 * @DateTime: 2024/10/18 14:09
 **/
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum EmailCodeTypeEnum {
    REGISTER(0, "注册邮箱验证码"),
    FORGET_PASSWORD(1, "忘记密码邮箱验证码"),
    ;

    private Integer code;

    private String desc;

    public static EmailCodeTypeEnum getEnumByCode(Integer code) {
        for (EmailCodeTypeEnum e : EmailCodeTypeEnum.values()) {
            if (e.getCode().equals(code)) {
                return e;
            }
        }
        return null;
    }
}
